/* src/assets/main.css */

/* 1. CSS Variables (可选, 但推荐用于主题化和一致性) */
:root {
  --font-primary: Avenir, Helvetica, Arial, sans-serif;
  --font-monospace: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;

  --color-text-primary: #2c3e50;
  --color-text-secondary: #555;
  --color-text-muted: #767676;
  --color-link: #007bff;
  --color-link-hover: #0056b3;
  --color-link-active: #42b983; /* Vue Green, for active router links */

  --color-background-body: #f8f9fa;
  --color-background-component: #ffffff;
  --color-border: #dee2e6;
  --color-border-light: #f1f1f1;

  --color-success: #28a745;
  --color-error: #dc3545;
  --color-warning: #ffc107;
  --color-info: #17a2b8;

  --border-radius-base: 4px;
  --spacing-base: 1rem; /* 16px by default */
  --spacing-small: calc(var(--spacing-base) * 0.5);
  --spacing-medium: var(--spacing-base);
  --spacing-large: calc(var(--spacing-base) * 1.5);
}

/* 2. Basic Reset & Normalization */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px; /* Base font size */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-background-body);
  min-height: 100vh;
  display: flex; /* For sticky footer if needed */
  flex-direction: column; /* For sticky footer if needed */
}

/* Ensure #app takes full height for sticky footer, if App.vue is direct child of body */
#app, #app-container { /* #app-container was in your App.vue */
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}


/* 3. Basic Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-medium);
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 2.25rem; } /* 36px */
h2 { font-size: 1.875rem; } /* 30px */
h3 { font-size: 1.5rem; } /* 24px */
h4 { font-size: 1.25rem; } /* 20px */

p {
  margin-bottom: var(--spacing-medium);
  color: var(--color-text-secondary);
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

/* Router link active style (if not handled specifically in component) */
/* .router-link-exact-active from your ReaderView.vue is more specific and fine there */

img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  max-width: 100%;
}


/* 4. Basic Form Styling (全局基础样式，组件内可覆盖) */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: var(--spacing-small) var(--spacing-medium);
  margin-bottom: var(--spacing-medium);
  font-family: var(--font-primary);
  font-size: 1rem;
  color: var(--color-text-primary);
  background-color: var(--color-background-component);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-base);
  box-sizing: border-box; /* Already set globally, but good to reinforce */
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-link);
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); /* Bootstrap-like focus */
}

textarea {
  min-height: 100px;
  resize: vertical;
}

button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
  display: inline-block;
  padding: calc(var(--spacing-small) + 2px) var(--spacing-large); /* Slightly more padding for buttons */
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background-color: var(--color-link);
  border: 1px solid var(--color-link);
  border-radius: var(--border-radius-base);
  cursor: pointer;
  transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
  margin-right: var(--spacing-small); /* Add some margin between buttons */
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover {
  background-color: var(--color-link-hover);
  border-color: var(--color-link-hover);
  color: #fff; /* Ensure text color remains white on hover */
}

button:disabled,
input:disabled {
  background-color: #e9ecef;
  border-color: #ced4da;
  color: #6c757d;
  cursor: not-allowed;
}

label {
  display: block;
  margin-bottom: var(--spacing-small);
  font-weight: 500;
  color: var(--color-text-primary);
}

/* Checkbox and Radio (basic styling, can be enhanced) */
input[type="checkbox"],
input[type="radio"] {
  margin-right: var(--spacing-small);
  vertical-align: middle;
}


/* 5. Utility Classes (可选) */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: var(--spacing-medium); }
.mb-1 { margin-bottom: var(--spacing-medium); }
/* ... add more as needed ... */

/* Message styling (can be used by components) */
.success-message {
  margin-top: var(--spacing-medium);
  padding: var(--spacing-medium);
  background-color: #e6ffed;
  border: 1px solid #b7ebc0;
  color: #007020;
  border-radius: var(--border-radius-base);
}
.error-message {
  margin-top: var(--spacing-medium);
  padding: var(--spacing-medium);
  background-color: #ffe6e6;
  border: 1px solid #ffb3b3;
  color: #990000;
  border-radius: var(--border-radius-base);
}

/* Basic Table Styling (can be enhanced in components) */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--spacing-medium);
}

th, td {
  padding: var(--spacing-small) var(--spacing-medium);
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

th {
  background-color: #f8f9fa; /* Slightly different from body for emphasis */
  font-weight: 600;
  color: var(--color-text-primary);
}

/* Responsive images */
img {
  height: auto;
}

/* 您可以在这里放一些全局样式，或者在 src/assets/main.css 中管理 */
#app-container {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  /* margin-top: 20px; (如果App.vue不再包含header/footer，可以调整或移除) */
}

/* ReaderView 中的样式可以移到其自身的 <style> 块或全局样式 */
header {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

header h1 {
  margin-bottom: 10px;
}

nav a { /* router-link 会被渲染成 a 标签 */
  margin: 0 10px;
  text-decoration: none;
  color: #007bff;
  font-weight: bold;
}

nav a.router-link-exact-active { /* 当前激活路由的样式 */
  color: #42b983;
  text-decoration: underline;
}

nav a:hover {
  text-decoration: underline;
}

main {
  padding: 20px;
}

hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid #eee;
}

footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  font-size: 0.9em;
  color: #666;
}